package com.lazyproject.modules.layer.controller;

import com.lazyproject.modules.layer.entity.Layer;
import com.lazyproject.modules.layer.service.ILayerService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author he_ls
 * @since 2025/1/13 15:11
 **/
@RestController
@RequestMapping(path = "/layer")
@Slf4j
//@Api(tags = "图层接口")
public class LayerController {
    @Resource
    protected ILayerService iLayerService;

    @GetMapping(path = "/getInfos", produces = {"application/json;charset=UTF-8"})
//    @ApiOperation(value = "普通接口")
    public List<Layer> getInfos() {
        return iLayerService.getInfos();
    }

    @GetMapping(path = "/getList", produces = {"application/json;charset=UTF-8"})
    public List<Layer> getList() {
        return iLayerService.list();
    }

    @GetMapping(path = "/getone", produces = {"application/json;charset=UTF-8"})
    public List<Layer> getOne(@RequestParam(value = "id") Integer id) {
        log.info("进入controller中：id :" + id);
        return iLayerService.getOne(id);
    }


}
